package com.estylesoft.pshevch.fw;

import org.openqa.selenium.By;

/**
 * Created with IntelliJ IDEA.
 * User: pshevchenko
 * Date: 08.04.13
 * Time: 10:13
 * To change this template use File | Settings | File Templates.
 */
public class NavigationHelper extends HelperBase {
    public NavigationHelper(ApplicationManager applicationManager) {
        super(applicationManager);
    }

    public void homePage() {
        clickElement(By.linkText("Home"));
    }

    public void reloadApp() {
        driver.get(appManager.getBaseUrl() + "/php4dvd/");
    }

    public boolean onHomePage() {
        appManager.changeTimeouts(5);
        boolean elementPresent = isElementPresent(By.xpath("//section/nav//a[@href=\"./?go=add\"]"));

        return elementPresent;
    }
}
